package com.sz.controller;

import com.sz.feign.RegTranjFeign;
import com.sz.feign.ToolFeign;
import com.sz.model.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/tool")
public class ToolController {

    @Autowired
    private ToolFeign toolFeign;

    @Autowired
    private RegTranjFeign regTranjFeign;

    //地址
    @RequestMapping("/ip")
    public String getIp(){
        return toolFeign.getIp();
    }

    //天气
    @RequestMapping(value = "/tq",method = RequestMethod.POST)
    public String getWether(@RequestBody String city){
        return toolFeign.getWether(city);
    }

    //获取银行卡信息
    @RequestMapping(value = "/account",method = RequestMethod.POST)
    public Result getBankCard(@RequestBody String card){
        return toolFeign.getBankCard(card);
    }

    //发送验证码
    @RequestMapping(value = "/phone")
    public Result getPhone(String phone){
        return toolFeign.getPhone(phone);
    }

    //短信
    @RequestMapping(value = "/smscode")
    public Result getPhoneSMS(String phone,String code){
        return toolFeign.getPhoneSMS(phone,code);
    }

    //判断付款账户余额
    @RequestMapping(value = "/amount",method = RequestMethod.POST)
    public Result getBankCardAmount(@RequestParam String amount, @RequestParam String account){
        Result bankCardAmount = toolFeign.getBankCardAmount(amount, account);
        return bankCardAmount;

    }

    @RequestMapping("/obc/onbanktran")
    public Result RegOnBankTran(){

        Result result = regTranjFeign.RegOnBankTran("2021076297909001530", new Long(1000));

        System.out.println(result.toString());


        return null;
    }


}
